import mongoose from '../dbHelper';
import { defaultSchemaExtend, defaultSchemaOptions } from "../config/index";

const Schema = mongoose.Schema;

const QianchuanAdShopSchema = new Schema(Object.assign({
    shopInfo: {
        type: Schema.Types.ObjectId,
        ref: 'Shop'
    },
    aavid: {
        type: Number,
        required: true
    },
    // 服务开始时间
    service_start_time: {
        type: Date,
        required: true
    },
    // 服务结束时间
    service_end_time: {
        type: Date,
        required: true
    },
    // 当前消耗的服务订单id
    current_service_order_id: {
        type: Schema.Types.ObjectId,
        ref: 'AiPayOrder'
    }
}, defaultSchemaExtend), defaultSchemaOptions);

const QianchuanAdShop = mongoose.model('QianchuanAdShop', QianchuanAdShopSchema, 'QianchuanAdShops');

export default QianchuanAdShop